#include <iostream>
#include <memory>
#include <functional>
#include "tcpserver.hpp"
#include "http.hpp"


void Usage(std::string proc)
{
    std::cout << "Usage:" << proc << "port" << std::endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        return 0;
    }
    uint16_t port = std::stoi(argv[1]);
    HttpServer httpserver;
    tcpserver tcpserver(port,std::bind(&HttpServer::HanderHttpRequest,&httpserver,std::placeholders::_1));
    tcpserver.start();
    return 0;
}
